From d5a3bc1a214b0bd384868062f0502732244c04f6 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Mon, 9 Jun 2014 16:41:08 +0100 Subject: [PATCH] tools/libxc: Use _Static_assert if available Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson Acked-by: Ian Campbell --- tools/libxc/xc_private.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h index 29e926c4ec..12476ec4ff 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -48,7 +48,11 @@ #define PAGE_MASK XC_PAGE_MASK /* Force a compilation error if condition is true */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#define XC_BUILD_BUG_ON(p) ({ _Static_assert(!(p), "!(" #p ")"); }) +#else #define XC_BUILD_BUG_ON(p) ((void)sizeof(struct { int:-!!(p); })) +#endif /* ** Define max dirty page cache to permit during save/restore -- need to balance -- 2.30.2